﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace SilverlightBase.Classes
{
	public class Xaml
	{
		/// <summary>
		/// Xaml used for the menu
		/// </summary>
		public class Menu
		{
			public enum menuItemType { Top = 1, TopSelected = 2, Sub = 3, SubSelected = 4 };

			public static string GetMenuItemXaml(menuItemType type, string text, int nodeId, int top, string selectedColour)
			{
				string xaml = "";

				switch (type)
				{
					case menuItemType.Top:
						xaml = ""
						+ "<Canvas xmlns=\"http://schemas.microsoft.com/client/2007\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" x:Name=\"Menu" + nodeId.ToString() + "\" Height=\"25\" Cursor=\"Hand\" Width=\"125\" Canvas.Top=\"" + top.ToString() + "\" Tag=\"" + nodeId.ToString() + "\">"
						+ "		<Rectangle Height=\"25\" Width=\"125\" RadiusX=\"0\" RadiusY=\"0\">"
						+ "			<Rectangle.Fill>"
						+ "				<LinearGradientBrush EndPoint=\"0.5,1\" StartPoint=\"0.5,0\">"
						+ "					<GradientStop Color=\"#FF353535\"/>"
						+ "					<GradientStop Color=\"#FF000000\" Offset=\"0.714\"/>"
						+ "				</LinearGradientBrush>"
						+ "			</Rectangle.Fill>"
						+ "		</Rectangle>"
						+ "		<TextBlock Height=\"12.333\" Width=\"117\" Foreground=\"#FFFFFFFF\" TextWrapping=\"Wrap\" TextAlignment=\"Left\" Canvas.Left=\"8\" Canvas.Top=\"6\">"
						+ "			<Run FontFamily=\"Verdana\" FontSize=\"11\" FontStretch=\"Normal\" FontStyle=\"Normal\" FontWeight=\"Bold\" Foreground=\"#FFFFFFFF\" Text=\"" + text + "\"/>"
						+ "		</TextBlock>"
						+ "</Canvas>";
						break;

					case menuItemType.TopSelected:
						xaml = ""
						+ "<Canvas xmlns=\"http://schemas.microsoft.com/client/2007\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" x:Name=\"Menu" + nodeId.ToString() + "\" Height=\"25\" Cursor=\"Hand\" Width=\"125\" Canvas.Top=\"" + top.ToString() + "\" Tag=\"" + nodeId.ToString() + "\">"
						+ "		<Rectangle Height=\"25\" Width=\"125\" RadiusX=\"0\" RadiusY=\"0\">"
						+ "			<Rectangle.Fill>"
						+ "				<LinearGradientBrush EndPoint=\"0.5,1\" StartPoint=\"0.5,0\">"
						+ "					<GradientStop Color=\"#FF353535\"/>"
						+ "					<GradientStop Color=\"#FF000000\" Offset=\"0.714\"/>"
						+ "				</LinearGradientBrush>"
						+ "			</Rectangle.Fill>"
						+ "		</Rectangle>"
						+ "		<TextBlock Height=\"12.333\" Width=\"117\" Foreground=\"#FFFFFFFF\" TextWrapping=\"Wrap\" TextAlignment=\"Left\" Canvas.Left=\"8\" Canvas.Top=\"6\">"
						+ "			<Run FontFamily=\"Verdana\" FontSize=\"11\" FontStretch=\"Normal\" FontStyle=\"Normal\" FontWeight=\"Bold\" Foreground=\"#" + selectedColour + "\" Text=\"" + text + "\"/>"
						+ "		</TextBlock>"
						+ "</Canvas>";
						break;

					case menuItemType.Sub:
						xaml = ""
						+ "<Canvas xmlns=\"http://schemas.microsoft.com/client/2007\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" x:Name=\"Menu" + nodeId.ToString() + "\" Height=\"25\" Cursor=\"Hand\" Width=\"125\" Canvas.Top=\"" + top.ToString() + "\" Tag=\"" + nodeId.ToString() + "\">"
						+ "		<TextBlock Height=\"12.333\" Width=\"117\" Foreground=\"#FFFFFFFF\" TextWrapping=\"Wrap\" TextAlignment=\"Left\" FontSize=\"11\" Canvas.Left=\"8\" Canvas.Top=\"6\">"
						+ "			<Run Text=\"" + text + "\" FontFamily=\"Verdana\" FontSize=\"11\" FontStretch=\"Normal\" FontStyle=\"Normal\" FontWeight=\"Bold\" Foreground=\"#FF000000\"/>"
						+ "		</TextBlock>"
						+ "</Canvas>";
						break;

					case menuItemType.SubSelected:
						xaml = ""
						+ "<Canvas xmlns=\"http://schemas.microsoft.com/client/2007\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" x:Name=\"Menu" + nodeId.ToString() + "\" Height=\"25\" Cursor=\"Hand\" Width=\"125\" Canvas.Top=\"" + top.ToString() + "\" Tag=\"" + nodeId.ToString() + "\">"
						+ "		<TextBlock Height=\"12.333\" Width=\"117\" Foreground=\"#FFFFFFFF\" TextWrapping=\"Wrap\" TextAlignment=\"Left\" FontSize=\"11\" Canvas.Left=\"20\" Canvas.Top=\"6\">"
						+ "			<Run Text=\"" + text + "\" FontFamily=\"Verdana\" FontSize=\"11\" FontStretch=\"Normal\" FontStyle=\"Normal\" FontWeight=\"Bold\" Foreground=\"#FF000000\"/>"
						+ "		</TextBlock>"
						+ "		<Rectangle Height=\"8\" Width=\"8\" Canvas.Left=\"8\" Canvas.Top=\"8\" RadiusX=\"0\" RadiusY=\"0\" Stroke=\"#FF000000\" Fill=\"#" + selectedColour + "\" StrokeThickness=\"0\"/>"
						+ "</Canvas>";
						break;
				}

				return xaml;
			}
		}

		/// <summary>
		/// Xaml used for the page content
		/// </summary>
		public class Content
		{
			public enum contentType { Main = 1, Media = 2, Teaser = 3, BlogEntry = 4, BlogComment = 5 };
			public enum contentWidth { Full = 757, Small = 538 };

			public static string GetMainContentXaml(contentType type, string headline, string content, string selectedColour, contentWidth width)
			{
				return GetMainContentXaml(type, headline, content, selectedColour, width, 0);
			}

			public static string GetMainContentXaml(contentType type, string headline, string content, string selectedColour, contentWidth width, int linkNodeId)
			{
				string xaml = "";

				switch (type)
				{
					case contentType.Main:
						xaml = string.Format(@"
						<Grid xmlns=""http://schemas.microsoft.com/client/2007"" xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"" x:Name=""MainContent"" Margin=""148,130,0,0"" VerticalAlignment=""Top"" HorizontalAlignment=""Left"" Width=""{0}"">
							<Rectangle HorizontalAlignment=""Stretch"" Margin=""-6,-20,-7,0"" Height=""500"" VerticalAlignment=""Top"" RadiusX=""5"" RadiusY=""5"">
								<Rectangle.Fill>
								<LinearGradientBrush EndPoint=""0.5,1"" StartPoint=""0.5,0"">
									<GradientStop Color=""#BBEAEAEA""/>
										<GradientStop Color=""#BBC0C0C0"" Offset=""1""/>
									</LinearGradientBrush>
								</Rectangle.Fill>
							</Rectangle>
							<Rectangle HorizontalAlignment=""Stretch"" Margin=""0,0,0,0"" Height=""25"" VerticalAlignment=""Top"" RadiusX=""0"" RadiusY=""0"">
								<Rectangle.Fill>
									<LinearGradientBrush EndPoint=""0.5,1"" StartPoint=""0.5,0"">
										<GradientStop Color=""#FF353535""/>
										<GradientStop Color=""#FF000000"" Offset=""1""/>
									</LinearGradientBrush>
								</Rectangle.Fill>
							</Rectangle>
							<TextBlock HorizontalAlignment=""Left"" Margin=""12,6,0,3"" x:Name=""MainContentHeadline"" FontFamily=""Verdana"" VerticalAlignment=""Stretch"" Width=""Auto"" Foreground=""#FFFFFFFF"" TextWrapping=""Wrap""></TextBlock>
							<Grid x:Name=""MainContentGrid"">
								<Grid.Clip>
									<RectangleGeometry Rect=""10,20,720,420"" />
								</Grid.Clip>
							</Grid>
							<Grid x:Name=""Scrollbar"" Width=""22"" HorizontalAlignment=""Right"" Margin=""0,60,0,-912"" VerticalAlignment=""Top"">
								<Path Height=""338"" HorizontalAlignment=""Center"" Margin=""3.5,2,3.5,4.19899988174438"" VerticalAlignment=""Stretch"" Stretch=""Fill"" Stroke=""#33000000"" Data=""M930.5,126 L930.5,456.80054"" />
								<Ellipse Height=""8"" HorizontalAlignment=""Center"" Margin=""0,0,0,0"" x:Name=""ScrollbarButTop"" VerticalAlignment=""Top"" Width=""8"">
									<Ellipse.Fill>
										<LinearGradientBrush EndPoint=""0.5,1"" StartPoint=""0.5,0"">
											<GradientStop Color=""#FF4D4D4D""/>
											<GradientStop Color=""#FF000000"" Offset=""1""/>
										</LinearGradientBrush>
									</Ellipse.Fill>
								</Ellipse>
								<Ellipse Height=""8"" HorizontalAlignment=""Center"" Margin=""0,0,0,0"" x:Name=""ScrollbarButBottom"" VerticalAlignment=""Bottom"" Width=""8"">
									<Ellipse.Fill>
										<LinearGradientBrush EndPoint=""0.5,1"" StartPoint=""0.5,0"">
											<GradientStop Color=""#FF4D4D4D""/>
											<GradientStop Color=""#FF000000"" Offset=""1""/>
										</LinearGradientBrush>
									</Ellipse.Fill>
								</Ellipse>
								<Canvas x:Name=""ScrollbarThumb"" Height=""20"" Margin=""1,0,1,0"" VerticalAlignment=""Top"" >
									<Ellipse Height=""20"" Width=""20"">
										<Ellipse.Fill>
											<LinearGradientBrush EndPoint=""0.5,1"" StartPoint=""0.5,0"">
												<GradientStop Color=""#FF525252"" Offset=""0""/>
												<GradientStop Color=""#FF000000"" Offset=""1""/>
											</LinearGradientBrush>
										</Ellipse.Fill>
									</Ellipse>
									<Path Height=""6"" Width=""6"" Stretch=""Fill"" RenderTransformOrigin=""0.5,0.5"" Data=""M57.25,-27.25 L73,-27.25 L73,-13.25 z"" Fill=""#{2}"" Canvas.Left=""7"" Canvas.Top=""9"">
										<Path.RenderTransform>
											<TransformGroup>
												<ScaleTransform/>
												<SkewTransform/>
												<RotateTransform Angle=""135""/>
												<TranslateTransform/>
											</TransformGroup>
										</Path.RenderTransform>
									</Path>
									<Path Height=""6"" Width=""6"" Fill=""#{2}"" Stretch=""Fill"" RenderTransformOrigin=""0.5,0.5"" Data=""M57.25,-27.25 L73,-27.25 L73,-13.25 z"" Canvas.Left=""7"" Canvas.Top=""5"">
										<Path.RenderTransform>
											<TransformGroup>
												<ScaleTransform/>
												<SkewTransform/>
												<RotateTransform Angle=""-45""/>
												<TranslateTransform/>
											</TransformGroup>
										</Path.RenderTransform>
									</Path>
								</Canvas>
							</Grid>
						</Grid>", (int)width, headline, selectedColour, ((int)width - 52));
						break;

					case contentType.Media:

						if (content.IndexOf(".png") > -1 || content.IndexOf(".jpg") > -1)
						{

							xaml = string.Format(@"
							<Grid xmlns=""http://schemas.microsoft.com/client/2007"" xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"" Margin=""0,0,0,0"" VerticalAlignment=""Top"" HorizontalAlignment=""Left"" Width=""{2}"" Height=""Auto"" x:Name=""MovieLayer"">
								<Rectangle HorizontalAlignment=""Stretch"" Margin=""1,0,-5,15"" VerticalAlignment=""Stretch"" RadiusX=""5"" RadiusY=""5"">
									<Rectangle.Fill>
										<LinearGradientBrush EndPoint=""0.5,1"" StartPoint=""0.5,0"">
											<GradientStop Color=""#BBC0C0C0""/>
											<GradientStop Color=""#BBC0C0C0"" Offset=""1""/>
										</LinearGradientBrush>
									</Rectangle.Fill>
								</Rectangle>
								<Image Margin=""15,15,10,32"" Width=""Auto"" Source=""{1}""/>
							</Grid>", selectedColour, content, (int)width + 9);
						}
						else
						{
							xaml = string.Format(@"
							<Grid xmlns=""http://schemas.microsoft.com/client/2007"" xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"" Margin=""0,0,0,0"" VerticalAlignment=""Top"" HorizontalAlignment=""Left"" Width=""{2}"" Height=""Auto"" x:Name=""MovieLayer"">
								<Rectangle HorizontalAlignment=""Stretch"" Margin=""1,0,-5,15"" VerticalAlignment=""Stretch"" RadiusX=""5"" RadiusY=""5"">
									<Rectangle.Fill>
										<LinearGradientBrush EndPoint=""0.5,1"" StartPoint=""0.5,0"">
											<GradientStop Color=""#BBC0C0C0""/>
											<GradientStop Color=""#BBC0C0C0"" Offset=""1""/>
										</LinearGradientBrush>
									</Rectangle.Fill>
								</Rectangle>
								<Grid Height=""39"" x:Name=""PlayButton"" HorizontalAlignment=""Center"" VerticalAlignment=""Bottom"" Margin=""0,0,0,28"" Cursor=""Hand"">
									<Ellipse HorizontalAlignment=""Right"" Margin=""0,0,0,0"" VerticalAlignment=""Stretch"" Width=""40"">
										<Ellipse.Fill>
											<LinearGradientBrush EndPoint=""0.5,1"" StartPoint=""0.5,0"">
												<GradientStop Color=""#FF000000"" Offset=""1""/>
												<GradientStop Color=""#FF515151"" Offset=""0""/>
											</LinearGradientBrush>
										</Ellipse.Fill>
									</Ellipse>
									<Ellipse HorizontalAlignment=""Right"" Margin=""0,0,3,0"" VerticalAlignment=""Center"" Width=""34"" Height=""34"" RenderTransformOrigin=""0.5,0.5"">
										<Ellipse.Fill>
											<LinearGradientBrush EndPoint=""0.5,1"" StartPoint=""0.5,0"">
												<GradientStop Color=""#FF000000"" Offset=""1""/>
												<GradientStop Color=""#FF515151"" Offset=""0""/>
											</LinearGradientBrush>
										</Ellipse.Fill>
										<Ellipse.RenderTransform>
											<TransformGroup>
												<ScaleTransform/>
												<SkewTransform/>
												<RotateTransform Angle=""-180""/>
												<TranslateTransform/>
											</TransformGroup>
										</Ellipse.RenderTransform>
									</Ellipse>
									<Canvas x:Name=""Play"">
										<Path Stretch=""Fill"" RenderTransformOrigin=""0.5,0.5"" Data=""M57.25,-27.25 L73,-27.25 L73,-13.25 z"" Fill=""#FF{0}"" Height=""15"" HorizontalAlignment=""Left"" Margin=""9.125,12.625,0,12.375"" VerticalAlignment=""Stretch"" Width=""15""><Path.RenderTransform><TransformGroup><ScaleTransform/><SkewTransform/><RotateTransform Angle=""45""/><TranslateTransform/></TransformGroup></Path.RenderTransform></Path>
									</Canvas>
									<Grid  HorizontalAlignment=""Stretch"" Margin=""14,14.625,13.9169998168945,12.375"" VerticalAlignment=""Stretch"" Width=""12.083"" x:Name=""Pause"" Visibility=""Collapsed"">
										<Rectangle Fill=""#FF{0}"" HorizontalAlignment=""Left"" Margin=""0,0,0,0"" VerticalAlignment=""Stretch"" Width=""4.583"" RadiusX=""0"" RadiusY=""0"" Stroke=""#FF000000"" StrokeThickness=""0""/>
										<Rectangle Fill=""#FF{0}"" HorizontalAlignment=""Right"" Margin=""0,0,0,0"" VerticalAlignment=""Stretch"" Width=""4.583"" RadiusX=""0"" RadiusY=""0"" Stroke=""#FF000000"" StrokeThickness=""0""/>
									</Grid>
								</Grid>
								<MediaElement AutoPlay=""False"" Margin=""15,15,10,80"" x:Name=""Movie"" Source=""{1}"" VerticalAlignment=""Top"" Cursor=""Hand""/>
							</Grid>", selectedColour, content, (int)width + 9);
						}
						break;

					case contentType.Teaser:
						xaml = string.Format(@"
						<Grid xmlns=""http://schemas.microsoft.com/client/2007"" xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"" x:Name=""Teaser"" Margin=""0,130,-667,0"" Height=""Auto"" Width=""Auto"" VerticalAlignment=""Top"" HorizontalAlignment=""Center"">
							<Grid Margin=""0,0,0,0"">
								<Grid Height=""Auto"" Margin=""0,0,0,0"" VerticalAlignment=""Top"" HorizontalAlignment=""Left"" Width=""Auto"">
									<Rectangle HorizontalAlignment=""Stretch"" Margin=""-9,-20,-6,-53"" VerticalAlignment=""Stretch"" RadiusX=""5"" RadiusY=""5"" Fill=""#BB848484""/>
									<TextBlock x:Name=""TeaserHeadline"" FontFamily=""Verdana"" FontWeight=""Bold"" HorizontalAlignment=""Left"" Margin=""5,-4,0,3"" VerticalAlignment=""Stretch"" Foreground=""#FFFFFFFF"" Width=""160"" TextWrapping=""Wrap"" Text=""Headline""></TextBlock>
									<Grid Margin=""5,17,12,0"" VerticalAlignment=""Top"" HorizontalAlignment=""Left"" x:Name=""TeaserTextGrid"">
									</Grid>
									<Canvas x:Name=""TeaserLink"" Tag=""{1}"" Height=""25"" Margin=""0,0,10,-46"" Cursor=""Hand"" Width=""80"" VerticalAlignment=""Bottom"" HorizontalAlignment=""Right"">
										<Rectangle Height=""26"" HorizontalAlignment=""Right"" Margin=""-6,-6,0,0"" VerticalAlignment=""Bottom"" Width=""90"" RadiusX=""13"" RadiusY=""13"">
											<Rectangle.Fill>
												<LinearGradientBrush EndPoint=""0.5,1"" StartPoint=""0.5,0"">
													<GradientStop Color=""#FF000000"" Offset=""0.388""/>
													<GradientStop Color=""#FF5C5C5C""/>
												</LinearGradientBrush>
											</Rectangle.Fill>
										</Rectangle>
										<TextBlock Height=""Auto"" Margin=""8,0,0,0"" VerticalAlignment=""Bottom"" FontFamily=""Verdana"" Text=""Read more"" TextWrapping=""Wrap"" Foreground=""#FF{0}"" HorizontalAlignment=""Right""/>
									</Canvas>		
								</Grid>
							</Grid>
						</Grid>", selectedColour, linkNodeId);
						break;

					case contentType.BlogComment:
						xaml = string.Format(@"
						<Grid xmlns=""http://schemas.microsoft.com/client/2007"" xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"" x:Name=""CommentLayer{1}"" Width=""770"" Height=""Auto"" VerticalAlignment=""Top"" HorizontalAlignment=""Left"" MinHeight=""51"">
							<Rectangle HorizontalAlignment=""Stretch"" Margin=""0,0,0,0"" VerticalAlignment=""Stretch"" RadiusX=""5"" RadiusY=""5"" x:Name=""CommentBg{1}"">
								<Rectangle.Fill>
									<LinearGradientBrush EndPoint=""0.5,1"" StartPoint=""0.5,0"">
										<GradientStop Color=""#BBC0C0C0""/>
										<GradientStop Color=""#BBC0C0C0"" Offset=""1""/>
									</LinearGradientBrush>
								</Rectangle.Fill>
							</Rectangle>
							<Rectangle Height=""24"" HorizontalAlignment=""Stretch"" Margin=""10,14,10,0"" VerticalAlignment=""Top"" RadiusX=""0"" RadiusY=""0"" x:Name=""CommentBgHeadline{1}"">
								<Rectangle.Fill>
									<LinearGradientBrush EndPoint=""0.5,1"" StartPoint=""0.5,0"">
										<GradientStop Color=""#FF353535""/>
										<GradientStop Color=""#FF000000"" Offset=""1""/>
									</LinearGradientBrush>
								</Rectangle.Fill>
							</Rectangle>
							<TextBlock Text=""Headline"" HorizontalAlignment=""Left"" Margin=""50,19,0,0"" x:Name=""CommentHeadline{1}"" FontFamily=""Verdana"" VerticalAlignment=""Top"" Width=""Auto"" Foreground=""#FFFFFFFF"" TextWrapping=""Wrap""></TextBlock>
							<Grid Height=""39"" x:Name=""CommentButton{1}"" HorizontalAlignment=""Left"" VerticalAlignment=""Top"" Margin=""4,6,0,0"" Cursor=""Hand"" Width=""39"">
								<Ellipse HorizontalAlignment=""Right"" Margin=""0,0,0,0"" VerticalAlignment=""Stretch"" Width=""38"" Height=""38"">
									<Ellipse.Fill>
										<LinearGradientBrush EndPoint=""0.5,1"" StartPoint=""0.5,0"">
											<GradientStop Color=""#FF000000"" Offset=""1""/>
											<GradientStop Color=""#FF515151"" Offset=""0""/>
										</LinearGradientBrush>
									</Ellipse.Fill>
								</Ellipse>
								<Ellipse HorizontalAlignment=""Right"" Margin=""0,0,3,0"" VerticalAlignment=""Center"" Width=""32"" Height=""32"" RenderTransformOrigin=""0.5,0.5"">
									<Ellipse.Fill>
										<LinearGradientBrush EndPoint=""0.5,1"" StartPoint=""0.5,0"">
											<GradientStop Color=""#FF000000"" Offset=""1""/>
											<GradientStop Color=""#FF515151"" Offset=""0""/>
										</LinearGradientBrush>
									</Ellipse.Fill>
									<Ellipse.RenderTransform>
										<TransformGroup>
											<ScaleTransform/>
											<SkewTransform/>
											<RotateTransform Angle=""-180""/>
											<TranslateTransform/>
										</TransformGroup>
									</Ellipse.RenderTransform>
								</Ellipse>
								<Canvas Margin=""-21,-16,0,0"" HorizontalAlignment=""Center"" VerticalAlignment=""Center"">
									<Path Stretch=""Fill"" RenderTransformOrigin=""0.5,0.5"" Data=""M57.25,-27.25 L73,-27.25 L73,-13.25 z"" Fill=""#FF{0}"" Height=""16"" Width=""16""><Path.RenderTransform><TransformGroup><ScaleTransform/><SkewTransform/><RotateTransform Angle=""45""/><TranslateTransform/></TransformGroup></Path.RenderTransform></Path>
									<Path Stretch=""Fill"" RenderTransformOrigin=""0.5,0.5"" Data=""M57.25,-27.25 L73,-27.25 L73,-13.25 z"" Height=""12"" Width=""12"" Fill=""#FF000000"" Canvas.Left=""2"" Canvas.Top=""2""><Path.RenderTransform><TransformGroup><ScaleTransform/><SkewTransform/><RotateTransform Angle=""45""/><TranslateTransform/></TransformGroup></Path.RenderTransform></Path>
									<Path Stretch=""Fill"" RenderTransformOrigin=""0.5,0.5"" Data=""M57.25,-27.25 L73,-27.25 L73,-13.25 z"" Height=""10"" Width=""10"" Fill=""#FF{0}"" Canvas.Left=""3"" Canvas.Top=""3""><Path.RenderTransform><TransformGroup><ScaleTransform/><SkewTransform/><RotateTransform Angle=""45""/><TranslateTransform/></TransformGroup></Path.RenderTransform></Path>
								</Canvas>
							</Grid>
							<TextBlock x:Name=""CommentText{1}"" FontFamily=""Verdana""  Height=""Auto"" Width=""Auto"" MaxWidth=""720"" HorizontalAlignment=""Left"" Margin=""20,50,0,20"" VerticalAlignment=""Top"" Text=""TextBlock"" TextWrapping=""Wrap"" Visibility=""Collapsed""/>
						</Grid>", selectedColour, linkNodeId.ToString());
						break;
				}

				return xaml;
			}
		}

		/// <summary>
		/// Xaml for comments on a blog post
		/// </summary>
		public class Comment
		{

			public static string AddCommentXaml()
			{
				return string.Format(@"
				<Grid xmlns=""http://schemas.microsoft.com/client/2007"" xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"" Margin=""142, 622, 0, 0""  x:Name=""CommentAddLayer"" Width=""770"" Height=""281"" MinHeight=""51"" VerticalAlignment=""Top"" HorizontalAlignment=""Left"">
					<Rectangle HorizontalAlignment=""Stretch"" Margin=""0,0,0,0"" VerticalAlignment=""Stretch"" RadiusX=""5"" RadiusY=""5"">
						<Rectangle.Fill>
							<LinearGradientBrush EndPoint=""0.5,1"" StartPoint=""0.5,0"">
								<GradientStop Color=""#BBC0C0C0""/>
								<GradientStop Color=""#BBC0C0C0"" Offset=""1""/>
							</LinearGradientBrush>
						</Rectangle.Fill>
					</Rectangle>
					<Rectangle Height=""24"" HorizontalAlignment=""Stretch"" Margin=""10,14,10,0"" VerticalAlignment=""Top"" RadiusX=""0"" RadiusY=""0"">
						<Rectangle.Fill>
							<LinearGradientBrush EndPoint=""0.5,1"" StartPoint=""0.5,0"">
								<GradientStop Color=""#FF353535""/>
								<GradientStop Color=""#FF000000"" Offset=""1""/>
							</LinearGradientBrush>
						</Rectangle.Fill>
					</Rectangle>
					<TextBlock Text=""Add comment"" x:Name=""CommentHeadline"" HorizontalAlignment=""Left"" Margin=""20,19,0,0"" FontFamily=""Verdana"" VerticalAlignment=""Top"" Width=""Auto"" Foreground=""#FFFFFFFF"" TextWrapping=""Wrap""/>
					<TextBlock Text=""Name"" HorizontalAlignment=""Left"" Margin=""20,52,0,0"" FontFamily=""Verdana"" VerticalAlignment=""Top"" Width=""Auto"" Foreground=""#FF000000"" TextWrapping=""Wrap""/>
					<TextBlock Text=""Email"" HorizontalAlignment=""Left"" Margin=""20,80,0,0"" FontFamily=""Verdana"" VerticalAlignment=""Top"" Width=""Auto"" Foreground=""#FF000000"" TextWrapping=""Wrap""/>
					<TextBlock Text=""Headline"" HorizontalAlignment=""Left"" Margin=""20,108,0,0"" FontFamily=""Verdana"" VerticalAlignment=""Top"" Width=""Auto"" Foreground=""#FF000000"" TextWrapping=""Wrap""/>
					<TextBox x:Name=""CommentAddName"" Width=""200"" Text="""" TextWrapping=""Wrap"" HorizontalAlignment=""Left"" VerticalAlignment=""Top"" Margin=""80,50,0,0""/>
					<TextBox x:Name=""CommentAddEmail"" Width=""200"" Text=""@"" TextWrapping=""Wrap"" HorizontalAlignment=""Left"" VerticalAlignment=""Top"" Margin=""80,78,0,0""/>
					<TextBox x:Name=""CommentAddHeadline"" Width=""200"" Text="""" TextWrapping=""Wrap"" HorizontalAlignment=""Left"" VerticalAlignment=""Top"" Margin=""80,106,0,0""/>
					<TextBox x:Name=""CommentAddComment"" Width=""716"" Height=""100"" Text=""Comment"" AcceptsReturn=""True"" VerticalScrollBarVisibility=""Auto"" TextWrapping=""Wrap"" HorizontalAlignment=""Left"" VerticalAlignment=""Top"" Margin=""21,134,0,0""/>
					<Grid x:Name=""CommentAddButton"" Cursor=""Hand"">
						<Rectangle Height=""26"" HorizontalAlignment=""Right"" Margin=""0,0,10,10"" VerticalAlignment=""Bottom"" Width=""90"" RadiusX=""13"" RadiusY=""13"">
							<Rectangle.Fill>
								<LinearGradientBrush EndPoint=""0.5,1"" StartPoint=""0.5,0"">
									<GradientStop Color=""#FF000000"" Offset=""0.388""/>
									<GradientStop Color=""#FF5C5C5C""/>
								</LinearGradientBrush>
							</Rectangle.Fill>
						</Rectangle>
						<TextBlock Height=""Auto"" Margin=""0,0,42,17"" VerticalAlignment=""Bottom"" FontFamily=""Verdana"" Text=""Post"" TextWrapping=""Wrap"" Foreground=""#FFFF0000"" HorizontalAlignment=""Right""/>
					</Grid>
				</Grid>", "");
			}
		}
	}
}
